//108
function sortedBST(nums, i = 0, j = nums.length - 1) {
  if (i > j) {
    return null;
  }
  if (i === j) {
    return {
      val: nums[i],
      left: null,
      right: null,
    };
  }
  let node = {};
  let center = Math.floor((j - i) / 2 + i);
  node.val = nums[center];
  node.left = sortedBST(nums, i, center - 1);
  node.right = sortedBST(nums, center + 1, j);
  return node;
}
console.log(sortedBST([-10, -3, 0, 5, 9]));
console.log(1);
